import requst from "@/utils/request";
//加入采花车
export const addCartItme = (data: object) => {
    return requst({
        url: '/client/cart/add',
        method: 'post',
        data: data
    })
}
//立即购买/加入采花车
export const buyNnowCartItme = (data: object) => {
    return requst({
        url: '/client/cart/buyNnow',
        method: 'post',
        data: data
    })
}
// 获取采花车所有商品
export const getCartItmeList = () => {
    return requst({
        url: '/client/cart/list',
        method: 'get'
    })
}
// 采花车商品增减
export const upQuantity = (data: object) => {
    return requst({
        url: '/client/cart/quantity',
        method: 'put',
        data: data
    })
}

//采花车删除商品
export const deleteCartItme = (ids: number[]) => {
    return requst({
        url: `/client/cart/${ids}`,
        method: 'delete'
    })
}
// 采花车选中状态
export const upIsChosen = (data: object) => {
    return requst({
        url: '/client/cart/isChosen',
        method: 'put',
        data: data
    })
}
// 修改所有购物车的商品为未选中状态
export const upIsChosenAll = () => {
    return requst({
        url: '/client/cart/isChosen/upAll',
        method: 'put'
    })
}
//获取用户购物车商品数量
export const getCartItmeCount = () => {
    return requst({
        url: '/client/cart/count',
        method: 'get'
    })
}